-
Notifications
You must be signed in to change notification settings - Fork 149
added post method, as get was failing on me. #57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
…added random header.
charsets = response.headers.get('content-type', '').lower() | ||
|
||
# Apply decoding for multiple content codings | ||
for coding in reversed(encoding.split(',')): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does requests not already do this?
not for me, I'm getting a great response, merge or no merge, i'm happy :)
It's doing what I want.
…On Wed, Jul 12, 2023 at 9:24 PM Nv7 ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In googlesearch/user_agents.py
<#57 (comment)>
:
>
-
-_useragent_list = [
+ """
+ return random.choice([
'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:66.0) Gecko/20100101 Firefox/66.0',
We only kept the common user agents since having a bunch was causing some
issues.
—
Reply to this email directly, view it on GitHub
<#57 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AIVZ7JABWDSROFYY4AAJXFDXP4BX5ANCNFSM6AAAAAAZYLMLWE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
--
[image: created with MySignature.io]
<https://mysignature.io/?utm_source=logo>
Lewis Morris
M: 07554202635
E: ***@***.***
[image: created with MySignature.io] <https://github.com/lewis-morris> [image:
created with MySignature.io]
<https://stackoverflow.com/users/3348264/lewis-morris>
|
I'm getting 429 errors - Too many requests as well. I think I can add more user agents to resolve the issue, and this PR is exactly (and above) what I need. If this is not merged, I'll raise a PR to add more user agents only. |
Worked for me when I was getting the same issue.
…On Thu, Sep 21, 2023 at 7:22 PM Nguyen Minh Thai ***@***.***> wrote:
I'm getting 429 errors - Too many requests as well. I think I can add more
user agents to resolve the issue, and this PR is exactly (and above) what I
need. If this is not merged, I'll raise a PR to add more user agents only.
—
Reply to this email directly, view it on GitHub
<#57 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AIVZ7JFQUL6SNA26GDFOENTX3SAU7ANCNFSM6AAAAAAZYLMLWE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
--
[image: created with MySignature.io]
<https://mysignature.io/?utm_source=logo>
Lewis Morris
M: 07554202635
E: ***@***.***
[image: created with MySignature.io] <https://github.com/lewis-morris> [image:
created with MySignature.io]
<https://stackoverflow.com/users/3348264/lewis-morris>
|
You could have a `use_additional_agents` flag which might help.
…On Fri, Sep 22, 2023 at 4:40 PM Lewis Morris ***@***.***> wrote:
Worked for me when I was getting the same issue.
On Thu, Sep 21, 2023 at 7:22 PM Nguyen Minh Thai ***@***.***>
wrote:
> I'm getting 429 errors - Too many requests as well. I think I can add
> more user agents to resolve the issue, and this PR is exactly (and above)
> what I need. If this is not merged, I'll raise a PR to add more user agents
> only.
>
> —
> Reply to this email directly, view it on GitHub
> <#57 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AIVZ7JFQUL6SNA26GDFOENTX3SAU7ANCNFSM6AAAAAAZYLMLWE>
> .
> You are receiving this because you authored the thread.Message ID:
> ***@***.***>
>
--
[image: created with MySignature.io]
<https://mysignature.io/?utm_source=logo>
Lewis Morris
M: 07554202635
E: ***@***.***
[image: created with MySignature.io] <https://github.com/lewis-morris> [image:
created with MySignature.io]
<https://stackoverflow.com/users/3348264/lewis-morris>
--
[image: created with MySignature.io]
<https://mysignature.io/?utm_source=logo>
Lewis Morris
M: 07554202635
E: ***@***.***
[image: created with MySignature.io] <https://github.com/lewis-morris> [image:
created with MySignature.io]
<https://stackoverflow.com/users/3348264/lewis-morris>
|
Sorry about the long delay! I think it would be a lot cleaner if you added a new file for post requests, as the |
Changes
too many requests
issues ( this solved that issue).Extra
I think these changes add an extra option for people who just want to grab urls - it appears to be faster with the post method also and I use regex to extract the url only (currently) - working on getting the advanced descriptions etc.